1. Field of the Invention
The present invention relates to a storage medium having an object-oriented program comprising objects having object items storing optional data and a plurality of functions processing data through the object items, and, more particularly, to a storage medium having an object-oriented program that reduces time and cost of class design and program development by dynamically creating various kinds of objects from one class.
2. Description of the Related Art
A conventional procedural-oriented program includes a data structure and an algorithm changing data. Because the conventional procedural-oriented program cannot express a relationship between the data and functions very well, repair and maintenance have been limited due to changes in the algorithm, and the reuse of source codes.
Thus, to produce a program of which the repair, maintenance, and code reuse can be easily accomplished, an object-oriented program is presented herein that achieves the intended result by allowing objects having typical data thereof and methods, i.e., functions performing operations with the data, to communicate with each other through messages.
Herein, the objects indicate program modules having functions associated with particular data, as conceptual units classified for effective data management. The data is used to store attributes of the objects, and the functions define functions that the objects can perform. Each object must have at least one item. In object-oriented programming languages such as C++, Java, Python, and the like, the objects are created from object classes that supply frames to the objects so that the objects can include and perform common characteristics and actions.
Herein, each object usually has data stored in items having a predetermined type and number. Thus, if the types or the number of the items are different from each other, the classes must be respectively defined for the objects.
Therefore, there needs to be a way to accomplish the repair, maintenance, and code reuse, which are aims of the object-oriented programming languages, by creating various kinds of objects from one class.
Object serialization is defined as streaming the objects for communicating content of the objects in a byte stream through files or networks. Also, restoring serialized data to an original object is defined hereinafter as deserialization. The advantages of the object serialization are to provide persistency since the content of the objects can be stored in files independently of input/output types, and to allow the objects to be easily communicated through networks.
C++ provides a serialization method in the object class to perform the serialization/deserialization, and allows the objects to be serialized. Thus, there is a problem that procedures overriding a serialization method on each class and customizing the overridden serialization method suitably to characteristics of each class must be accompanied, for the object serialization.